package com.smart.mip.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;


/**
 * create by scaffold 2017-07-18 
 * @author codefan@sina.com
 
  角色信息null   
*/
@Entity
@Table(name = "F_ROLE_INFO")
public class RoleInfo implements java.io.Serializable {
	private static final long serialVersionUID =  1L;



	/**
	 * 角色代码 null 
	 */
	@Id
	@Column(name = "ROLE_CODE")
	@GeneratedValue(generator = "assignedGenerator")
	@GenericGenerator(name = "assignedGenerator", strategy = "uuid")
	private String roleCode;

	/**
	 * 角色名称 null 
	 */
	@Column(name = "ROLE_NAME")
	@Length(max = 64, message = "字段长度不能大于{max}")
	private String  roleName;
	/**
	 * 角色类别 S为系统功能角色 I 为项目角色 W工作量角色 
	 */
	@Column(name = "ROLE_TYPE")
	@Length(max = 1, message = "字段长度不能大于{max}")
	private String  roleType;
	/**
	 * 角色说明 null 
	 */
	@Column(name = "ROLEDESC")
	@Length(max = 256, message = "字段长度不能大于{max}")
	private String  roledesc;
	/**
	 * 更新时间 null 
	 */
	@Column(name = "updateDate")
	private Date  updatedate;
	/**
	 * 创建时间 null 
	 */
	@Column(name = "CreateDate")
	private Date  createdate;


	// Constructors
	/** default constructor */
	public RoleInfo() {
		super();
	}
	/** minimal constructor */
	public RoleInfo(
		String roleCode		
		) {
	
	
		this.roleCode = roleCode;		
			
	}

/** full constructor */
	public RoleInfo(
	 String roleCode		
	,String  roleName,String  roleType,String  roledesc,Date  updatedate,Date  createdate) {
	
	
		this.roleCode = roleCode;		
	
		this.roleName= roleName;
		this.roleType= roleType;
		this.roledesc= roledesc;
		this.updatedate= updatedate;
		this.createdate= createdate;		
	}
	

  
	public String getRoleCode() {
		return this.roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
	// Property accessors
  
	public String getRoleName() {
		return this.roleName;
	}
	
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
  
	public String getRoleType() {
		return this.roleType;
	}
	
	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}
  
	public String getRoledesc() {
		return this.roledesc;
	}
	
	public void setRoledesc(String roledesc) {
		this.roledesc = roledesc;
	}
  
	public Date getUpdatedate() {
		return this.updatedate;
	}
	
	public void setUpdatedate(Date updatedate) {
		this.updatedate = updatedate;
	}
  
	public Date getCreatedate() {
		return this.createdate;
	}
	
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	
public RoleInfo copy(RoleInfo other){
  
		this.setRoleCode(other.getRoleCode());
  
		this.roleName= other.getRoleName();  
		this.roleType= other.getRoleType();  
		this.roledesc= other.getRoledesc();  
		this.updatedate= other.getUpdatedate();  
		this.createdate= other.getCreatedate();

		return this;
	}
	
	public RoleInfo copyNotNullProperty(RoleInfo other){
  
	if( other.getRoleCode() != null){
	this.setRoleCode(other.getRoleCode());}
  
		if( other.getRoleName() != null)
			this.roleName= other.getRoleName();  
		if( other.getRoleType() != null)
			this.roleType= other.getRoleType();  
		if( other.getRoledesc() != null)
			this.roledesc= other.getRoledesc();  
		if( other.getUpdatedate() != null)
			this.updatedate= other.getUpdatedate();  
		if( other.getCreatedate() != null)
			this.createdate= other.getCreatedate();		

		return this;
	}

	public RoleInfo clearProperties(){
  
		this.roleName= null;  
		this.roleType= null;  
		this.roledesc= null;  
		this.updatedate= null;  
		this.createdate= null;

		return this;
	}
}
